<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<?php



if(isset($_GET['x'])&&$_GET['charset']&&$_GET['y']){
    $x = $_GET['x'];
    $charset = $_GET['charset'];
    $y = $_GET['y'];

    switch ($charset){
        case '+':
            echo $x+$y;
            break;
        case '-':
            echo $x-$y;
            break;
        case '*':
            echo $x*$y;
            break;
        case '/':
            echo $x/$y;
            break;
    }
}


?>


<form action="">

    第一个数字：<input type="text" name="x">
    <br><br>
    运算符：<select name="charset">
        <option>+</option>
        <option>-</option>
        <option>*</option>
        <option>/</option>
    </select>
    <br><br>
    第二个数字：<input type="text" name="y">
    <br><br>
    <input type="submit" value="计算">
</form>







</body>
</html>